<?php

include_once ("mysql_conn.php");
$id = $_GET['id'];
$option = $_GET['option'];
$conn = new mysql_conn();
$conn->add_upadate("update `order` set status = '".$option."' where id = ".$id.";");
if ($_SESSION['perssime']==1) {
    if ($option == 2) {
        echo "<script>alert('确认收货成功!');window.location='homeCustomerOrders.php';</script>";
    } else if ($option == 0) {
        echo "<script>alert('退货成功成功!');window.location='homeCustomerOrders.php';</script>";
    } else if ($option == 3) {
        echo "<script>alert('发货成功!');window.location='homeCustomerOrders.php';</script>";
    } else if ($option == 4) {
        echo "<script>alert('订单完成!');window.location='homeCustomerOrders.php';</script>";
    }
}else{
    if ($option == 2){
        echo "<script>alert('确认收货成功!');window.location='homeAdminOrders.php';</script>";
    } else  if ($option ==0){
        echo "<script>alert('退货成功成功!');window.location='homeAdminOrders.php';</script>";
    }else  if ($option == 3){
        echo "<script>alert('发货成功!');window.location='homeAdminOrders.php';</script>";
    }else  if ($option ==4){
        echo "<script>alert('订单完成!');window.location='homeAdminOrders.php';</script>";
    }
}
?>